package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.MessageSettingModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * Created by DF on 10/17/2016.
 *
 */
public interface MessageSettingRepository extends JpaRepository<MessageSettingModel, Integer>, JpaSpecificationExecutor<MessageSettingModel> {
    @Query("select m.user from  MessageSettingModel m  where m.permit = ?1 and m.type=?2 and m.checked=?3")
   String finduser(String permit, String type, String checked);

    @Query("select a from MessageSettingModel a where a.permit=?1 and a.type=?2 and a.checked=?3")
    MessageSettingModel findByPermitAndType(String permit, String type, String checked);
}
